<?php /* -*- PHP -*- */
/**
  * XiteCode primary ajax handler
  *
  * @copyright (c) 2006 A.Sleep <a.sleep@asleep.net> under the GNU GPL version 2
  * @author A.Sleep <a.sleep@asleep.net>
  * @package core
  */

require 'Global.php';

if ((!XiteCode::getMethod() and !XiteCode::postMethod()) or (!$pathInfo = XiteCode::parsePathInfo())) {
  exit;
}

switch ($pathInfo[1]) {
 default:
   // Default action is via GET
   if (XiteCode::updateByAjax($pathInfo[1], $_POST['value'])) {
     echo $_POST['value'];
     exit;
   }
   echo 'Error. See Log.';
   break;
}
exit;
?>
